package com.coreJava.test02;

import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

/**
 * 作者: LCG
 * 日期: 2019/9/3 10:33
 * 描述:
 */
public class Test0202 {

    public static void main(String[] args) throws Exception{

        FutureTask futureTask=new FutureTask(new Callable() {
            @Override
            public Object call() throws Exception {

                System.out.println("==========");

                Thread.sleep(5000);

                return "ooooo";
            }
        });

        Thread thread=new Thread(futureTask);

        thread.start();

        futureTask.get();

        System.out.println("________");



    }

}
